package view;

import javax.swing.JComponent;

import model.ISPGraph;

public abstract class AbstractGraphView extends JComponent implements GraphView {

	// FIELDS
	private static final long serialVersionUID = 4049526535887756842L;
	
	private ISPGraph model;
	
	// CONSTRUCTEURS
	protected AbstractGraphView(ISPGraph model) {
		if (model == null) {
			throw new IllegalArgumentException("model argument is null");
		}
		this.model = model;
	}
	
	// METHODS
	@Override
	public abstract void updateView();

	@Override
	public ISPGraph getModel() {
		return this.model;
	}
	
	public void setModel(ISPGraph model) {
		if (model == null) {
			throw new IllegalArgumentException("model argument is null");
		}
		this.model = model;
	}
	
}
